package com.aigc.txt2img.entity;

import com.fasterxml.jackson.annotation.JsonProperty;

class NotifyData {

    private String images;
//    private String generateStatus;
//    private String styleName;

    public String getImages() {
        return images;
    }

    public void setImages(String images) {
        this.images = images;
    }

    @Override
    public String toString() {
        return "Data{" +
                "images='" + images + '\'' +
                '}';
    }

    //    public String getGenerateStatus() {
//        return generateStatus;
//    }
//
//    public void setGenerateStatus(String generateStatus) {
//        this.generateStatus = generateStatus;
//    }
//
//    public String getStyleName() {
//        return styleName;
//    }
//
//    public void setStyleName(String styleName) {
//        this.styleName = styleName;
//    }
}

class Result {
    private Integer code;
    private String msg;
    private NotifyData data;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public NotifyData getData() {
        return data;
    }

    public void setData(NotifyData data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "Result{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", data=" + data +
                '}';
    }
}

public class NotifyRequest {

    private Result result;
    @JsonProperty(value="request_id")
    private String requestId;

    public Result getResult() {
        return result;
    }

    public void setResult(Result result) {
        this.result = result;
    }

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public String getImage() {

        if (this.result != null) {
            NotifyData data = this.result.getData();
            if (data != null) {
                return data.getImages();
            }
        }
        return requestId;
    }

    @Override
    public String toString() {
        return "NotifyRequest{" +
                "result=" + result +
                ", requestId='" + requestId + '\'' +
                '}';
    }
}
